<script src="vue.js"></script>

<div id="app">
    <button @click="add">添加</button>
    <table border="1">
        <tr>
            <td>工号</td>
            <td>姓名</td>
            <td>联系电话</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in terlist">
            <td>{{item.cord}}</td>
            <td>{{item.uname}}</td>
            <td>{{item.tel}}</td>
            <td>
            <button @click="update">修改</button>
            <button @click="del">删除</button>
            </td>
        </tr>
    </table>
</div>
<script>
    var vue=new Vue({
        el:'#app',
        data:{
            terlist:[],
        },
        methods:{
            add(){
                console.log("进入添加方法");
                var terache={
                    cord:"001",
                    uname:"李老师",
                    tel:"13822117765"
                }
                this.terlist.push(terache);
            },
            update(){
                alert("准备开始更新数据");
            },
            del(){
                this.terlist.pop();
            },
        }
    })
</script>